package sofia.Persistencia.Entidades;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author crisfalt
 */
@Entity
@Table(name = "Terapia", catalog = "Sofia", schema = "")
@NamedQueries({
    @NamedQuery(name = "ETerapia.findAll", query = "SELECT e FROM ETerapia e"),
    @NamedQuery(name = "ETerapia.findByIdTerapia", query = "SELECT e FROM ETerapia e WHERE e.idTerapia = :idTerapia"),
    @NamedQuery(name = "ETerapia.findByPacienteId", query = "SELECT e FROM ETerapia e WHERE e.pacienteId = :pacienteId"),
    @NamedQuery(name = "ETerapia.findByFisioId", query = "SELECT e FROM ETerapia e WHERE e.fisioId = :fisioId"),
    @NamedQuery(name = "ETerapia.findByUrlVideo", query = "SELECT e FROM ETerapia e WHERE e.urlVideo = :urlVideo"),
    @NamedQuery(name = "ETerapia.findByComentarioVideo", query = "SELECT e FROM ETerapia e WHERE e.comentarioVideo = :comentarioVideo"),
    @NamedQuery(name = "ETerapia.findByProgresoYLogros", query = "SELECT e FROM ETerapia e WHERE e.progresoYLogros = :progresoYLogros"),
    @NamedQuery(name = "ETerapia.findByFechaTerapia", query = "SELECT e FROM ETerapia e WHERE e.fechaTerapia = :fechaTerapia"),
    @NamedQuery(name = "ETerapia.findByHoraTerapia", query = "SELECT e FROM ETerapia e WHERE e.horaTerapia = :horaTerapia")})
public class ETerapia implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_terapia", nullable = false)
    private Integer idTerapia;
    @Basic(optional = false)
    @Column(name = "paciente_id", nullable = false, length = 20)
    private String pacienteId;
    @Basic(optional = false)
    @Column(name = "fisio_id", nullable = false, length = 50)
    private String fisioId;
    @Column(name = "url_video", length = 150)
    private String urlVideo;
    @Column(name = "comentario_video", length = 300)
    private String comentarioVideo;
    @Basic(optional = false)
    @Column(name = "progreso_y_logros", nullable = false, length = 500)
    private String progresoYLogros;
    @Basic(optional = false)
    @Column(name = "fecha_terapia", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fechaTerapia;
    @Column(name = "hora_terapia")
    @Temporal(TemporalType.TIME)
    private Time horaTerapia;
    @JoinColumn(name = "secretaria_id", referencedColumnName = "id_secretaria", nullable = false)
    @ManyToOne(optional = false)
    private ESecretaria eSecretaria;

    public ETerapia() {
    }

    public ETerapia(Integer idTerapia) {
        this.idTerapia = idTerapia;
    }

    public ETerapia(Integer idTerapia, String pacienteId, String fisioId, String progresoYLogros, Date fechaTerapia) {
        this.idTerapia = idTerapia;
        this.pacienteId = pacienteId;
        this.fisioId = fisioId;
        this.progresoYLogros = progresoYLogros;
        this.fechaTerapia = fechaTerapia;
    }

    public Integer getIdTerapia() {
        return idTerapia;
    }

    public void setIdTerapia(Integer idTerapia) {
        this.idTerapia = idTerapia;
    }

    public String getPacienteId() {
        return pacienteId;
    }

    public void setPacienteId(String pacienteId) {
        this.pacienteId = pacienteId;
    }

    public String getFisioId() {
        return fisioId;
    }

    public void setFisioId(String fisioId) {
        this.fisioId = fisioId;
    }

    public String getUrlVideo() {
        return urlVideo;
    }

    public void setUrlVideo(String urlVideo) {
        this.urlVideo = urlVideo;
    }

    public String getComentarioVideo() {
        return comentarioVideo;
    }

    public void setComentarioVideo(String comentarioVideo) {
        this.comentarioVideo = comentarioVideo;
    }

    public String getProgresoYLogros() {
        return progresoYLogros;
    }

    public void setProgresoYLogros(String progresoYLogros) {
        this.progresoYLogros = progresoYLogros;
    }

    public Date getFechaTerapia() {
        return fechaTerapia;
    }

    public void setFechaTerapia(Date fechaTerapia) {
        this.fechaTerapia = fechaTerapia;
    }

    public Time getHoraTerapia() {
        return horaTerapia;
    }

    public void setHoraTerapia(Time horaTerapia) {
        this.horaTerapia = horaTerapia;
    }

    public ESecretaria getESecretaria() {
                return eSecretaria;
        }

        public void setESecretaria(ESecretaria eSecretaria) {
                this.eSecretaria = eSecretaria;
        }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTerapia != null ? idTerapia.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ETerapia)) {
            return false;
        }
        ETerapia other = (ETerapia) object;
        if ((this.idTerapia == null && other.idTerapia != null) || (this.idTerapia != null && !this.idTerapia.equals(other.idTerapia))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sofia.Persistencia.Entidades.ETerapia[idTerapia=" + idTerapia + "]";
    }

}
